﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace MainApp
{
    public partial class FrmGetDate : DevExpress.XtraEditors.XtraForm
    {
        public FrmGetDate()
        {
            InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void dateEdit_EditValueChanged(object sender, EventArgs e)
        {
            btnOK.Enabled = true;
            btnOK.Focus();
        }

        public DateTime GetDate()
        {
            return (DateTime)dateEdit.EditValue;
        }

        private void FrmGetDate_Load(object sender, EventArgs e)
        {
            dateEdit.EditValue = DateTime.Today;
        }

    }
}